#include "ISWUpdate.h" 
#include "Archive.h"
#include "IServlet.h"
const char *ISWUpdateServlet::__businessName__="ISWUpdateServlet";
struct ISWUpdateServlet_open_proto {
};
struct ISWUpdateServlet_stop_proto {
};
IMP_SERIALIZE_OBJECT(ISWUpdateServlet_open_proto) {
};
IMP_SERIALIZE_OBJECT(ISWUpdateServlet_stop_proto) {
};
void ISWUpdateServlet::open(IServlet *servlet ) {
    ISWUpdateServlet_open_proto __iner__proto;
    std::string __proto_name__ = "ISWUpdateServlet::open";
    ByteArray *out = NULL;
    Stream ss(__iner__proto,&out);
    int size = out->size();
    std::string __content;
    __content.resize(size+4+__proto_name__.size()); {
    int intS = __proto_name__.size(); memcpy(&__content[0],&intS,4);
    memcpy(&__content[4],&__proto_name__[0],__proto_name__.size());
    memcpy(&__content[4+intS],out->pointer() , size);
    servlet->request(&__content[0], __content.size());
    }
}
void ISWUpdateServlet::stop(IServlet *servlet ) {
    ISWUpdateServlet_stop_proto __iner__proto;
    std::string __proto_name__ = "ISWUpdateServlet::stop";
    ByteArray *out = NULL;
    Stream ss(__iner__proto,&out);
    int size = out->size();
    std::string __content;
    __content.resize(size+4+__proto_name__.size()); {
    int intS = __proto_name__.size(); memcpy(&__content[0],&intS,4);
    memcpy(&__content[4],&__proto_name__[0],__proto_name__.size());
    memcpy(&__content[4+intS],out->pointer() , size);
    servlet->request(&__content[0], __content.size());
    }
}
int ISWUpdateServlet::dispatchActions(ISession *session,void *data,int size) {
    std::string name;
    int strS = *(int*)data;
    name.resize(strS);
    memcpy(&name[0],((char*)data)+4,strS);
   if (name == "ISWUpdateServlet::open") {
        ISWUpdateServlet_open_proto __iner__proto;
    	Stream ss(__iner__proto,((unsigned char*)data)+(strS+4),size - 4 - strS);		
        open(session);
   }
   else if (name == "ISWUpdateServlet::stop") {
        ISWUpdateServlet_stop_proto __iner__proto;
    	Stream ss(__iner__proto,((unsigned char*)data)+(strS+4),size - 4 - strS);		
        stop(session);
   }
    return 0;
}
const char *ISWUpdateServletTest::__businessName__="ISWUpdateServletTest";
struct ISWUpdateServletTest_SWUpdateTest_proto {
    int x;
    int y;
};
IMP_SERIALIZE_OBJECT(ISWUpdateServletTest_SWUpdateTest_proto) {
    BIND_SERIALIZE(x, 0);
    BIND_SERIALIZE(y, 1);
};
void ISWUpdateServletTest::SWUpdateTest(IServlet *servlet ,const int& x,const int& y) {
    ISWUpdateServletTest_SWUpdateTest_proto __iner__proto;
    std::string __proto_name__ = "ISWUpdateServletTest::SWUpdateTest";
    __iner__proto.x=x; 
    __iner__proto.y=y; 
    ByteArray *out = NULL;
    Stream ss(__iner__proto,&out);
    int size = out->size();
    std::string __content;
    __content.resize(size+4+__proto_name__.size()); {
    int intS = __proto_name__.size(); memcpy(&__content[0],&intS,4);
    memcpy(&__content[4],&__proto_name__[0],__proto_name__.size());
    memcpy(&__content[4+intS],out->pointer() , size);
    servlet->request(&__content[0], __content.size());
    }
}
int ISWUpdateServletTest::dispatchActions(ISession *session,void *data,int size) {
    std::string name;
    int strS = *(int*)data;
    name.resize(strS);
    memcpy(&name[0],((char*)data)+4,strS);
   if (name == "ISWUpdateServletTest::SWUpdateTest") {
        ISWUpdateServletTest_SWUpdateTest_proto __iner__proto;
    	Stream ss(__iner__proto,((unsigned char*)data)+(strS+4),size - 4 - strS);		
        SWUpdateTest(session,__iner__proto.x, __iner__proto.y);
   }
    return 0;
}
